<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="">

    <title>singcms内容管理平台</title>

    <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <!-- <link href="signin.css" rel="stylesheet"> -->



    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>

    <![endif]-->
</head>

<body>
<style>
    .s_center {
      margin-left: auto;
      margin-right: auto;
    }
</style>
<div class="s_center container col-lg-6 ">

      <form class="form-signin" enctype="multipart/form-data" method="post">
        <h2 class="form-signin-heading">请登录</h2>
        <label class="sr-only">用户名</label>
        <input type="text"  class="form-control" name="username" placeholder="请填写用户名" required autofocus>
        <br />
        <label  class="sr-only">密码</label>
        <input type="password" name="password" id="inputPassword" class="form-control" placeholder="密码" required>
        <br />
        <button class="btn btn-lg btn-primary btn-block" type="button">登录</button>
      </form>

</div> <!-- /container -->
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/dialog/layer.js"></script>
<script src="__PUBLIC__/js/dialog.js"></script>
<!-- <script src="__PUBLIC__/js/admin/login.js"></script> -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script type="text/javascript">
      $('button:eq(0)').click(function(){
          var username = $('input[name="username"]').val();
          var password = $('input[name="password"]').val();

          if(!username) {
              dialog.error('用户名不能为空');
          }
          if(!password) {
              dialog.error('密码不能为空');
          }
          var url = "__URL__/check";
          var data = {'username':username,'password':password};
          // 执行异步请求  $.post
          $.post(url,data,function(result){
            if(result.status == 0) {
                return dialog.error(result.message);
            }
            if(result.status == 1) {
                return dialog.success(result.message, "{:U('admin/index/index')}");
            }

        },'JSON'); 
    });
</script>
</body>
</html>
